import { useRoutes } from 'react-router-dom';
import Home from '../views/Home'
// import About from '../views/About'
import { lazy, Suspense } from 'react'
import Loading from '../views/Loading';
const About = lazy(() => import('../views/About'));

const RouterView = () => {
  const routes = useRoutes([
    {
      path: "/",
      element: <Home />
    }, {
      path: "/about",
      // element: <Suspense fallback={<div>loading</div>}>
      element: <Suspense fallback={<Loading />}>
        <About />
      </Suspense>
    }
  ])
  return routes;
}
export default RouterView;